@extends('layout')
@section('head')
    @parent
@stop
@section('content')
    <div class="register_header">登录豆辨</div>
    <form id="form" method="post" action="{{url('verify')}}">
        <div class="register_input">
            <div class="register_item">
                <label>帐号</label><input class="register_item_input" id="email" name="email">
            </div>
            <div class="register_item">
                <label>密码</label><input type="password" class="register_item_input" id="password" name="password">

            </div>

            <input type="button" id="register" class="register_button" value="登录" onclick="login()">
        </div>
    </form>
    <script>
        function login() {
            $.post(
                "{{url('verify')}}",
                {
                    email:$("#email").val(),
                    password:$("#password").val()
                },
                function (data) {
                    if(data=="right"){
                        window.location.href = document.referrer;
                    }else{
                        alert(data);
                    }
                }
            );

        }
        function test() {
            document.getElementById("form").submit();
        }
    </script>
@stop
@section('foot')

    @stop

